package com.lhb.SC.admin.web;

import com.lhb.SC.admin.feign.UserFeign2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.lhb.SC.admin.feign.UserFeign;
import com.lhb.SC.model.user.User;
import com.lhb.SC.web.context.ResponseResult;

@RequestMapping("/user")
@RestController
public class UserController {

    @Autowired
    private UserFeign userFeign;

    @Autowired
    private UserFeign2 userFeign2;

    @GetMapping("/get")
    public ResponseResult<User> getUserById(@RequestParam("userId") Long userId) {
        return userFeign.getUserById(userId);
    }

    @GetMapping("/get2")
    public ResponseResult<User> getUserById2(@RequestParam("userId") Long userId) {
        return userFeign2.getUserById(userId);
    }
}
